unit MunicipioSearchFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, Buttons, DBGrids, StdCtrls, MainSearchFr;

type

  { TMunicipioSearchFrame }

  TMunicipioSearchFrame = class(TMainSearchFrame)
    EditIdMunicipio: TEdit;
    EditNomeMunicipio: TEdit;
    EditUF: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    procedure LocalizarButtonClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses MunicipioDM,QueryConditions;

{ TMunicipioSearchFrame }

procedure TMunicipioSearchFrame.LocalizarButtonClick(Sender: TObject);
var
  condicoes: TQueryConditions;
begin
  condicoes := TQueryConditions.Create(CON_AND);
  condicoes.Add('id_municipio', EditIdMunicipio.Text);
  condicoes.AddText('nome_municipio', EditNomeMunicipio.Text);
  condicoes.AddText('uf', EditUF.Text);
  MunicipioData.Search(Condicoes, 'municipio');
end;

initialization
  {$I municipiosearchfr.lrs}

end.

